<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>登录页面</title>
<script type="text/javascript">
function checkempty(){
	if(document.getElementById("username2").value=='' || document.getElementById("password2").value=='')
	{
		alert("请填写");
		return false;
	}
	//else{
	//	document.getElementById("loginform").submit();
	//	return true;
	//}
}

function show(){
	var nouser = ${result};
	var validate = ${validate};
	if(nouser == 1)
		alert("没有该用户");
	if(validate == 1){
		alert("密码错误，您还有2次机会输入");
	}
	else if(validate == 2){
		alert("密码错误，您还有1次机会输入");
	}
	else if(validate == 3){
		alert("您的账号已被冻结，请联系管理员为你解冻");
	}
	else if(validate == 4){
		alert("您已提交申请，请等待管理员批准");
	}
}
</script>
</head>

<body onload="show()">

<div id="login">
	<s:form id="loginform" action="loginAction" method="post" onsubmit="return checkempty();">
		<s:textfield id="username2" name="username" label="用户名 : "/>
		<s:password id="password2" name="password" label="密码      : "/>
		<s:submit value=" 登录 "/>
	</s:form>
</div>

<!-- 
<div id="login">
	<form id="loginform" name="loginform" method="post" action="loginAction" onsubmit="return checkempty();">
		<label>
			<font color="red">*</font>用户名 :
		</label>
		<input type="text" id="username" name="username" maxlength="20" />
		<br/>
		<label>
			<font color="red">*</font>密码 :
		</label>
		<input type="password" id="password" name="password" maxlength="20" />
		<br/>
		<input type="submit" id="submit" name="submit" class="submit" value="Submit" />
	</form>
</div>
  -->
<div class="link">
	<a href="<s:url value="/view/management/grandgf_register.jsp" />">注册新用户 </a>|
	<a href="#">忘记密码</a>
</div>
<div class="clear"></div>
</body>
</html>